package com.java.service.impl;

import com.java.mapper.RegisterMapper;
import com.java.pojo.Student_info;
import com.java.pojo.Teacher_info;
import org.apache.ibatis.annotations.Insert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * description:描述
 * author:作者
 * time:2020/11/22 23:27
 */
@Service
public class RegisterServiceImpl implements com.java.service.RegisterService {

    @Autowired
    private RegisterMapper registerMapper;

    /**
     * 注册添加教师信息
     * @param teacher_info
     * @return
     */
    @Override
    public boolean addTeacherInfo(Teacher_info teacher_info){
        String  uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
        teacher_info.setUuid(uuid);
        return registerMapper.insertTeacherInfo(teacher_info)==1;
    }

    /**
     * 注册插入学生信息
     * @param student_info
     * @return
     */
    public boolean addStudentInfo(Student_info student_info){
        String uuid = UUID.randomUUID().toString().replace("-","").toLowerCase();
        student_info.setUuid(uuid);
        return registerMapper.insertStudentInfo(student_info)==1;
    }
}
